package com.wine.exam.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.wine.common.annotation.Excel;
import com.wine.common.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 试卷题目答案对象 exam_answer
 *
 * @author wine
 * @date 2022-12-14
 */
@Getter
@Setter
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("exam_paper")
public class Answer implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 试卷题目答案表主键
     */
    @TableId(value = "answer_id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long answerId;

    /**
     * 关联题目id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "关联题目id不能为空")
    @TableField(value = "question_id")
    @Excel(name = "关联题目id")
    private Long questionId;

    /**
     * 试卷名称
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "试卷id不能为空")
    @Excel(name = "试卷id")
    @TableField("paper_id")
    private Long paperId;

    /**
     * 试卷名称
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "试卷答题表id不能为空")
    @Excel(name = "试卷答题表id")
    @TableField("paper_answer_id")
    private Long paperAnswerId;

    /**
     * 得分
     */
    @Excel(name = "得分")
    @TableField("customer_score")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customerScore;

    /**
     * 题目原始分数
     */
    @Excel(name = "题目原始分数")
    @TableField("question_score")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long questionScore;

    /**
     * 做题答案
     */
    @Excel(name = "做题答案")
    @TableField("answer")
    private String answer;

    /**
     * 是否正确
     */
    @Excel(name = "是否正确")
    @TableField("do_right")
    private String doRight;

    /**
     * 哪位学生做的题
     */
    @Excel(name = "哪位学生做的题")

    @NotBlank(message = "做题人不能为空")
    @TableField(value = "create_user")
    private Long createUser;


    /**
     * 创建人
     */

    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


    /**
     * 更新人
     */

    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
